<?=$headerHtml?>
       <div class="container">
                <h2 class="admintitle">子类管理<div class="admintitle_r"></div></h2>
                <div id="srchuserdiv" class="tabcontentcur" style="width:99%;">
                    <form name="subListForm" id="subListForm" method="post" action="?c=<?=$ctlName?>&a=edit">
                    <table  class="datalist fixwidth">
						<tbody><tr>
							<th nowrap="nowrap" width="100">选择</th>
							<th nowrap="nowrap">id</th>
							<th nowrap="nowrap">频道名</th>
							<th nowrap="nowrap">子类名</th>
							<th nowrap="nowrap">路径</th>
						</tr>
                            <?
                            if($list) {
                                foreach($list as $row){
                                    $option      = array('data'=>$classCache,'type'=>'N','name'=>'classId['.$row['id'].']','key'=>$row['classId']);
                                    $classSel    = $classCache ? Libs_GlobalFunc::createSelectElement($option) : '';


                                    ?>
                                
                                <tr>
                                    <td width="20"><input type="checkbox" name="subClassId[]" value="<?=$row['id']?>"></td>
                                    <td width="50"><?=$row['id']?></td>
                                    <td><?=$classSel?></td>
                                    <td ><input name="name[<?=$row['id']?>]" id="nameSub" value="<?=$row['name']?>"></td>
                                    <td ><input name="path[<?=$row['id']?>]" id="pathSub" value="<?=$row['path']?>"></td>
                                </tr>
                                <?
                                }?>
                                <tr>
                                    <td>
                                        <label><input type="checkbox" name="checkAll" id="checkAll"> 全选</label>
                                    </td>
                                    <td colspan="4">
                                        <input name="edit" type="submit" value="批量修改">&nbsp;&nbsp;
                                        <input name="del" type="submit" value="批量删除">&nbsp;&nbsp;
                                        <input type="reset" value="重置">
                                    </td>
                                </tr>
                                <?
                              } else { ?>
                                    <div class="mainbox">
                                        <div class="note">
                                            <p class="i">目前没有相关数据!</p>
                                        </div>
                                    </div>
                               <? }?>
                        </tbody>
                    </table>
                    </form>
                    <div class="pageBar"><?=$pageBar?></div>
                    </br>
                    <form name="addSubForm" id="addSubForm" method="POST" action="?c=<?=$ctlName?>&a=add" onsubmit="return Zvalidator.checkForm(this)">
                    <table  class="datalist fixwidth">
                    <tbody>
                        <tr>
							<th nowrap="nowrap"></th>
							<th nowrap="nowrap">id</th>
							<th nowrap="nowrap">频道名</th>
							<th nowrap="nowrap">子类名</th>
							<th nowrap="nowrap">路径</th>
                            <th nowrap="nowrap">操作</th>
						</tr>
                        <tr>
                            <td width="20"></td>
                            <td width="50">1</td>
                            <td>
                                <?
                                    $option2     = array('data'=>$classCache,'type'=>'N','name'=>'classId','otherstr'=>'validator="require"');
                                    $classSelect = $classCache ? Libs_GlobalFunc::createSelectElement($option2) : '';
                                ?>
                               <?=$classSelect?></td>
                            <td><textarea name="name" id="name" validator="require"></textarea></td>
                            <td><textarea name="path" id="path"></textarea></td>
                            <td>
                                <input type="submit" value="添加子类">
                                <input type="reset" value="重置">
                            </td>
                        </tr>
					</tbody>
                    </table>
                   </form>
            </div>
        </div>
    </body>
<script language="javascript">
$(document).ready(function(){
    /*全选*/
    $("#checkAll").click(function(){
        var isChk = $("#checkAll").attr('checked');
        $("input[name='subClassId[]']").attr('checked',isChk);
    });
    /*表单验证*/
    Zvalidator.init();
 });
</script>
</html>
